package com.ruoyi.work.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.work.mapper.WorkRequestFundMapper;
import com.ruoyi.work.domain.WorkRequestFund;
import com.ruoyi.work.service.IWorkRequestFundService;
import com.ruoyi.common.core.text.Convert;

/**
 * 我的请款Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-23
 */
@Service
public class WorkRequestFundServiceImpl implements IWorkRequestFundService 
{
    @Autowired
    private WorkRequestFundMapper workRequestFundMapper;

    /**
     * 查询我的请款
     * 
     * @param requestId 我的请款主键
     * @return 我的请款
     */
    @Override
    public WorkRequestFund selectWorkRequestFundByRequestId(Long requestId)
    {
        return workRequestFundMapper.selectWorkRequestFundByRequestId(requestId);
    }

    /**
     * 查询我的请款
     *
     * @param requestIds 我的请款主键
     * @return 我的请款
     */
    @Override
    public List<WorkRequestFund> selectWorkRequestFundByRequestIds(String[] requestIds)
    {
        return workRequestFundMapper.selectWorkRequestFundByRequestIds(requestIds);
    }
    /**
     * 查询我的请款列表
     * 
     * @param workRequestFund 我的请款
     * @return 我的请款
     */
    @Override
    public List<WorkRequestFund> selectWorkRequestFundList(WorkRequestFund workRequestFund)
    {
        return workRequestFundMapper.selectWorkRequestFundList(workRequestFund);
    }

    /**
     * 新增我的请款
     * 
     * @param workRequestFund 我的请款
     * @return 结果
     */
    @Override
    public int insertWorkRequestFund(WorkRequestFund workRequestFund)
    {
        workRequestFund.setCreateTime(DateUtils.getNowDate());
        return workRequestFundMapper.insertWorkRequestFund(workRequestFund);
    }

    /**
     * 修改我的请款
     * 
     * @param workRequestFund 我的请款
     * @return 结果
     */
    @Override
    public int updateWorkRequestFund(WorkRequestFund workRequestFund)
    {
        workRequestFund.setUpdateTime(DateUtils.getNowDate());
        return workRequestFundMapper.updateWorkRequestFund(workRequestFund);
    }

    /**
     * 批量删除我的请款
     * 
     * @param requestIds 需要删除的我的请款主键
     * @return 结果
     */
    @Override
    public int deleteWorkRequestFundByRequestIds(String requestIds)
    {
        return workRequestFundMapper.deleteWorkRequestFundByRequestIds(Convert.toStrArray(requestIds));
    }

    /**
     * 删除我的请款信息
     * 
     * @param requestId 我的请款主键
     * @return 结果
     */
    @Override
    public int deleteWorkRequestFundByRequestId(Long requestId)
    {
        return workRequestFundMapper.deleteWorkRequestFundByRequestId(requestId);
    }
}
